package com.health.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.health.pojo.Setmeal;
import com.health.service.SetMealService;
import com.health.vo.PageResult;
import com.health.vo.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/setMeal")
public class SetMealController {

    @Reference
    private SetMealService setMealService;

    /**
     * 套餐分页条件查询
     */
    @GetMapping("/findPage/{pageNow}/{pageSize}")
    public Result findPage(@PathVariable Integer pageNow, @PathVariable Integer pageSize, String query) {
        PageResult<Setmeal> pageResult = setMealService.findPage(pageNow, pageSize, query);

        //封装返回结果
        return new Result(true, "套餐分页查询成功", pageResult);
    }
}